package productModel;

import java.util.ArrayList;

public class Books extends ProductItem {

//	String productName;
//	int productId;
	String category;
	String subCategory;
	String attributes;
	String price;
	String desc;
	String image1, image2, image3, image4;
	
	public void getProductDetailsFromEAV(ArrayList<ProductEAV> prodEAV){
		
		for(int i=0; i<prodEAV.size(); i++){
			if(prodEAV.get(i).getProdAttribute().equalsIgnoreCase("category"))
				this.setCategory(prodEAV.get(i).getProdValue());
			else if(prodEAV.get(i).getProdAttribute().equalsIgnoreCase("subCategory"))
				this.setSubCategory(prodEAV.get(i).getProdValue());
			else if(prodEAV.get(i).getProdAttribute().equalsIgnoreCase("price"))
				this.setPrice(prodEAV.get(i).getProdValue());
			else if(prodEAV.get(i).getProdAttribute().equalsIgnoreCase("desc"))
				this.setDesc(prodEAV.get(i).getProdValue());
			else if(prodEAV.get(i).getProdAttribute().equalsIgnoreCase("image1"))
				this.setImage1(prodEAV.get(i).getProdValue());
			else if(prodEAV.get(i).getProdAttribute().equalsIgnoreCase("image2"))
				this.setImage2(prodEAV.get(i).getProdValue());
			else if(prodEAV.get(i).getProdAttribute().equalsIgnoreCase("image3"))
				this.setImage3(prodEAV.get(i).getProdValue());
			else if(prodEAV.get(i).getProdAttribute().equalsIgnoreCase("image4"))
				this.setImage4(prodEAV.get(i).getProdValue());
		}
		this.setAttributes(ProductEAV.getAttributes(prodEAV));
	}
		
	public void showDetails(){
		System.out.println(this.productId);
		System.out.println(this.productName);
		System.out.println(this.category);
		System.out.println(this.subCategory);
		System.out.println(this.price);
		System.out.println(this.attributes);
		System.out.println(this.image1);
		System.out.println(this.image2);
		System.out.println(this.image3);
		System.out.println(this.image4);
	}
		
	
	public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	public String getSubCategory() {
		return subCategory;
	}
	public void setSubCategory(String subCategory) {
		this.subCategory = subCategory;
	}
	public String getAttributes() {
		return attributes;
	}

	public void setAttributes(String attributes) {
		this.attributes = attributes;
	}

	public String getPrice() {
		return price;
	}
	public void setPrice(String price) {
		this.price = price;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	public String getImage1() {
		return image1;
	}
	public void setImage1(String image1) {
		this.image1 = image1;
	}
	public String getImage2() {
		return image2;
	}
	public void setImage2(String image2) {
		this.image2 = image2;
	}
	public String getImage3() {
		return image3;
	}
	public void setImage3(String image3) {
		this.image3 = image3;
	}
	public String getImage4() {
		return image4;
	}
	public void setImage4(String image4) {
		this.image4 = image4;
	}
}
